import "./assets/main.css";

import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import ElementPlus from "element-plus";
import zhCn from 'element-plus/es/locale/lang/zh-cn.mjs' // 中文语言
import "element-plus/dist/index.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import plugins from "./plugins";
import { createStore } from "vuex";

// 分页组件
import Pagination from '@/components/Pagination/index.vue'

// 创建一个新的 store 实例
const store = createStore({
  state() {
    return {
      homeInited: false,
    };
  },
  mutations: {
    homeInited(state) {
      state.homeInited++;
    },
  },
});

const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.component('Pagination', Pagination)

app.use(router);
app.use(ElementPlus, { locale: zhCn });
app.use(plugins);
app.use(store);

app.mount("#app");
